From: Florian Müllner Date: Thu, 7 Mar 2019 12:39:17 +0000 (+0100) Subject: userWidget: Fix avatar size X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~871^2^2~37^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b90f4d29a4287a5786d76037b6fe3222ff86982e;p=gnome-shell.git userWidget: Fix avatar size The texture cache now returns an actor with an appropriate ClutterContent rather than a ClutterTexture. That actor uses the CONTENT_SIZE request mode, which means that it will unconditionally request the preferred size of the content. That is, setting an explicit size no longer has an effect. Fix this by making sure the image is already loaded with the desired dimensions. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1024 --- diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js index a3bf4cba1..a11b34b02 100644 --- a/js/ui/userWidget.js +++ b/js/ui/userWidget.js @@ -46,15 +46,14 @@ var Avatar = class { if (iconFile) { let file = Gio.File.new_for_path(iconFile); this.actor.child = null; - this.actor.style = 'background-image: url("%s");'.format(iconFile); + this.actor.style = ` + background-image: url("${iconFile}"); + background-size: ${this._iconSize}px`; } else { this.actor.style = null; this.actor.child = new St.Icon({ icon_name: 'avatar-default-symbolic', icon_size: this._iconSize }); } - - let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; - this.actor.set_size(this._iconSize * scaleFactor, this._iconSize * scaleFactor); } };